package aaaWAR;
public class LCS {

	public static void main(String[] args) {
		LCS lcs = new LCS();
		char[][] i = lcs.lcs("ababababababa","abcdbabaacd");
		for (char[] cs : i) {
			System.out.println(cs);
		}
	}
	 public char[][] lcs(String str1, String str2) { 
		 	
		    int len1 = str1.length();  
		    int len2 = str2.length();  
		    char c[][] = new char[len1+1][len2+1];  
		    for (int i = 1; i <= len1; i++) {  
		        for( int j = 1; j <= len2; j++) {
		        	
		        if(str1.charAt(i-1) == str2.charAt(j-1)) {  
		        	 c[i][j] = str1.charAt(i-1);  
		      
		        }  
		    }  
		   
		}
		    return c;  
}
}